//
//  MyReservationControl.m
//  WE
//
//  Created by iMacOne on 15/11/28.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "MyReservationControl.h"
#import <Masonry.h>
#import "Size.h"
#import "RegistrationViewController.h"
@implementation MyReservationControl

- (void)viewDidLoad
{
    self.navigationItem.title = @"预约单(0)";
//    [self.navigationController.navigationBar setTitleTextAttributes:
//  @{NSFontAttributeName:[UIFont systemFontOfSize:17],
//    NSForegroundColorAttributeName:[UIColor blackColor]}];
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatView];

   
}
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = NO;
    
}

- (void)creatView
{
    UILabel * lbl = [UILabel new];
    [self.view addSubview:lbl];
//    lbl.backgroundColor = DEBUG_CLOLR;
    lbl.text = @"您还没有预约过任何医生";
    lbl.font = FONT(14);
    lbl.textColor = [UIColor grayColor];
//    lbl.textAlignment = NSTextAlignmentCenter;
    [lbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).with.offset(120);
        make.centerX.equalTo(self.view);
//        make.size.mas_equalTo(CGSizeMake(200, 20));
        make.height.offset(20);
    }];
    
    
    UILabel * lbl1 = [UILabel new];
    [self.view addSubview:lbl1];
//    lbl1.backgroundColor = DEBUG_CLOLR;
    lbl1.text = @"如何预约挂号:";
    lbl1.font = FONT(14);
//    lbl1.textColor = [UIColor grayColor];
//    lbl1.textAlignment = NSTextAlignmentCenter;
    [lbl1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl).with.offset(60);
        make.left.equalTo(lbl).with.offset(lbl.frame.origin.x);
        make.height.mas_equalTo(20);
//        make.size.mas_equalTo(CGSizeMake(200, 20));
    }];
    
    
    UILabel * lbl2 = [UILabel new];
    [self.view addSubview:lbl2];
//    lbl2.backgroundColor = DEBUG_CLOLR;
    lbl2.text = @"选择科室医生";
    lbl2.font = FONT(14);
//    lbl1.textColor = [UIColor grayColor];
    //    lbl1.textAlignment = NSTextAlignmentCenter;
    [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl1).with.offset(22);
        make.left.equalTo(lbl).with.offset(15);
        make.height.mas_equalTo(20);
//        make.size.mas_equalTo(CGSizeMake(200, 20));
    }];
    
    UILabel * lbl3 = [UILabel new];
    [self.view addSubview:lbl3];
//    lbl3.backgroundColor = DEBUG_CLOLR;
    lbl3.text = @"填写预约信息";
    lbl3.font = FONT(14);
    //    lbl1.textColor = [UIColor grayColor];
    //    lbl1.textAlignment = NSTextAlignmentCenter;
    [lbl3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl2).with.offset(22);
        make.left.equalTo(lbl1).with.offset(15);
        make.height.mas_equalTo(20);
//        make.size.mas_equalTo(CGSizeMake(200, 20));
    }];

    UILabel * lbl4 = [UILabel new];
    [self.view addSubview:lbl4];
//    lbl4.backgroundColor = DEBUG_CLOLR;
    lbl4.text = @"凭身份证和短信去医院就诊";
    lbl4.numberOfLines = 0;
    lbl4.font = FONT(14);
    //    lbl1.textColor = [UIColor grayColor];
        lbl1.textAlignment = NSTextAlignmentLeft;
    [lbl4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl3).with.offset(22);
        make.left.equalTo(lbl1).with.offset(15);
        
//        make.size.width.offset(200);
        make.height.mas_equalTo(20);
//        make.centerY.equalTo(self.view);
//        make.size.mas_equalTo(CGSizeMake(200, 0));
    }];
    
    UIButton * btn = [UIButton new];
    [self.view addSubview:btn];
    btn.backgroundColor = [UIColor blueColor];
    [btn setTitle:@"快速挂号" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(doClick:) forControlEvents:UIControlEventTouchUpInside];
    btn.titleLabel.font = FONT(14);
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(lbl4).offset(CGRectGetMaxY(lbl4.frame) + 80);
        make.left.equalTo(self.view).offset(10);
        make.centerX.equalTo(self.view);
//        make.size.mas_equalTo(CGSizeMake(200, 40));
        make.height.offset(40);
    }];

}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    CGFloat sectionHeaderHeight = 10;//设置你footer高度
    if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
        scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
    } else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
        scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
    }
}
- (void)doClick:(UIButton *)btn
{
    [self.navigationController pushViewController:[[RegistrationViewController alloc] init] animated:YES];
}

@end
